package com.oa.tools.service;

import java.util.ArrayList;
import java.util.List;

//import org.springframework.security.core.authority.SimpleGrantedAuthority;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import com.oa.tools.entity.AnyUser;

/**
 * 自定义 UserDetailsService
 */
@Service
public class AnyUserDetailsService /*implements UserDetailsService*/ {
 
//    private final UserService userService;
// 
//    public AnyUserDetailsService(UserService userService){
//        this.userService = userService;
//    }
 
//    @Override
//    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
////        if (user == null){
////            throw new UsernameNotFoundException("用户不存在");
////        }
//        List<SimpleGrantedAuthority> authorities = new ArrayList<>();
//        //对应的权限添加
//        authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
//        AnyUser anyUser = new AnyUser(s, "password", authorities);
//        anyUser.setId(1L);
//        anyUser.setNickname("nickName");
//        return anyUser;
//    }
 
}
